﻿using System.Collections.Generic;
using System.Reflection;

namespace MugenInjection.Interface.Components
{
    /// <summary>
    /// The base interface for components for the automatically finds and loads modules from assemblies.
    /// </summary>
    public interface IModuleManagerComponent : IComponent
    {
        /// <summary>
        /// Loads modules defined in the specified assemblies.
        /// </summary>
        /// <param name="assemblies">The assemblies to search.</param>
        void LoadModules(params Assembly[] assemblies);

#if SCANASSEMBLY

        /// <summary>
        /// Indicates whether the automatic scan of the files, default is <c>true</c>.
        /// </summary>
        bool AutoScanAssembly { get; set; }

        /// <summary>
        /// Gets the extensions for load. The default extensions is .exe and .dll.
        /// </summary>
        IList<string> Extensions { get; }

        /// <summary>
        /// Gets the excluded files.
        /// </summary>
        IList<string> ExcludedFiles { get; }

        /// <summary>
        /// Rescans files.
        /// </summary>
        void RescanFiles();
#endif

#if !NOLOADASSEMBLY
        /// <summary>
        /// Loads "auto modules" defined in the loaded assemblies.
        /// </summary>
        void UpdateAutoLoadModuleIfNeed();
#endif
    }
}